<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.jiutian.util.CheckUtil"%>
<%@page import="com.jiutian.util.StringUtils"%>
<%@page import="com.jiutian.hotel.business.impl.HotelListManagerImpl"%>
<%
//String path = request.getContextPath();
//String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String hotelid=request.getParameter("hotelid");
HotelListManagerImpl impl=new HotelListManagerImpl();
List<Object[]> hotelinfo=(List<Object[]>)request.getAttribute("hotelinfo");
List<Object[]> roominfo=(List<Object[]>)request.getAttribute("roominfo");
List<Object[]> commentinfo=(List<Object[]>)request.getAttribute("commentinfo");
int tuiJian=0;
int buTuiJian=0;
int tuiJianBi=100;
if(!CheckUtil.isEmptyList(commentinfo)){
	for(int k=0;k<commentinfo.size();++k){
		Object[] comment=commentinfo.get(k);
		String type=(String)comment[0];
		if("1".equals(type))
			tuiJian=((java.math.BigInteger)comment[1]).intValue();
		else if("2".equals(type))
			buTuiJian=((java.math.BigInteger)comment[1]).intValue();
	}
}
int total=tuiJian+buTuiJian;
if(total!=0)
	tuiJianBi=tuiJian*100/total;
Object[] hoteldetail=hotelinfo.get(0);
ArrayList<String> todayAndTommorow=com.jiutian.util.Constants.getDate("yyyy-MM-dd",1);
String CheckInDate=(String)request.getSession().getAttribute("CheckInDate");//主页search时设置的
String CheckOutDate=(String)request.getSession().getAttribute("CheckOutDate");
if(StringUtils.isBlank(CheckInDate) || StringUtils.isBlank(CheckOutDate)){
	CheckInDate=todayAndTommorow.get(0);
	CheckOutDate=todayAndTommorow.get(1);
}
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>北京酒店</title>
	
    <meta http-equiv="keywords" content="酒店,酒店预订"/>
    <meta http-equiv="description" content="九天是主要面向大学生提供酒店预订服务，价格低廉，品质优越"/>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
<link href="../css/my.css" rel="stylesheet"/>
<link href="../css/hotel_comment.css" rel="stylesheet"/>
<link href="../css/jquery-ui-1.8.13.custom.css" rel="stylesheet"/>
<script type="text/javascript" src="../js/jquery-1.6.1.min.js"></script>
<script type="text/javascript" src="../js/jquery-ui-1.8.13.custom.min.js"></script>
<script type="text/javascript" src="../js/jquery-ui-i18n.min.js"></script>
<script type="text/javascript" src="http://api.map.baidu.com/api?key=46ce9d0614bf7aefe0ba562f8cf87194&v=1.1&services=false"></script>
<script>
	//var haveenterkey=true;//标记能回车提交，如:搜索、提交订单时
	function searchsubmit(){
		if($("#HotelName").val()=='如：如家')
			$("#HotelName").val('');
		if($("#Region").val()=='如：清华大学')
			$("#Region").val('');
		return true;
	}
	$(function() {
	
		//************设置小地图*********//
		var map = new BMap.Map("smallmap");          //
		map.disableDragging();
		map.disableScrollWheelZoom();
		map.setDefaultCursor('pointer');
		var point = new BMap.Point(<%=hoteldetail[10] %>, <%=hoteldetail[11] %>);  //
		map.centerAndZoom(point, 15);                 //
		var marker = new BMap.Marker(point);        // 创建标注  
		map.addOverlay(marker);
		//************设置小地图*********//
	
		$.datepicker.setDefaults($.datepicker.regional['zh-CN']);//设置国家
		$.datepicker.setDefaults({dateFormat:'yy-mm-dd'});	//设置日期格式	 
		$( "#CheckInDate" ).datepicker({ minDate: +0 });
		$( "#CheckOutDate" ).datepicker({ minDate: +0 });
		$("#bigmap").click(function(e) {//弹出dialog显示大地图
            e.preventDefault();
            var $this = $(this);
            var horizontalPadding = 30;
            var verticalPadding = 30;

$("#jiaotongweizhi").html($("#jiaotongweizhis").html());
            $("#bigmapwindow").dialog({
                title: '地图',
                autoOpen: true,
                width: 600,
                height: 500,
                modal: true,
                resizable: false,
                autoResize: false,
                overlay: {opacity: 0.5,background: "white"}
            }).width(600 - horizontalPadding).height(500 - verticalPadding);
var map = new BMap.Map("container");
map.enableScrollWheelZoom();
var point = new BMap.Point(<%=hoteldetail[10]%>, <%=hoteldetail[11]%>);
map.centerAndZoom(point, 11);
map.addControl(new BMap.NavigationControl());
var marker = new BMap.Marker(point);        // 创建标注  
map.addOverlay(marker);
        });
		$("#photos").click(function(e) {//弹出dialog显示多个照片
            e.preventDefault();
            var $this = $(this);
            var horizontalPadding = 40;
            var verticalPadding = 30;
            $('<iframe id="externalSite" frameborder="0" src="guonei/hotel_photo.jsp?hotelid=<%=hoteldetail[0] %>" />').dialog({
                title: '<%=hoteldetail[1] %>图片集',
                autoOpen: true,
                width: 600,
                height: 500,
                modal: true,
                resizable: false,
                autoResize: false,
                overlay: {opacity: 0.5,background: "white"}
            }).width(600 - horizontalPadding).height(500 - verticalPadding);
        });
		$("#HotelName").click(function(){
			if($(this).val()=='如：如家'){
				$(this).val('');
			}
		} );
		$("#Region").click(function(){
			if($(this).val()=='如：清华大学'){
				$(this).val('');
			}
		} );
		$("#dianping").click(function(){
			$("#jieshao").removeClass("on");
			$("#dianping").addClass("on");
			$("#hotelcontent").load("guonei/hotel_comment.jsp?hotelid=<%=hotelid %>&time="+new Date().getTime());
		} );
		$(".regionClick").click(function(){
			$("#InCityName").val('');
			$("#CheckInDate").val('');
			$("#CheckOutDate").val('');
			$("#HotelName").val('');
			$("#Region").val($(this).text());
			document.searchForm.submit();
		})
	});
	function goToOrderPage(roomid,price){
		document.location.href="../hotel/guonei/hotel_order.jsp?hotelid=<%=hotelid %>&checkin=<%=CheckInDate %>&checkout=<%=CheckOutDate %>&roomid="+roomid;
	}
</script>
<style>
</style>
  </head>
  
  <body>
	<jsp:include page="../bar.jsp" />
    <div id="d_hlistj">
    	<div class="bread"><div><a href="#">首页</a>&nbsp;&gt;&gt;<a href="#">酒店 </a>&gt;&gt;<a href="#"> 北京酒店</a></div></div>
    <div class="h_r">	
		    <div class="pl5">
		      <!--顶部酒店信息-->
				<div id="basic_info">
		        <!--头部价格 有房型才显示 机+酒来的不显示--> 
		        <!-- 
		        <div style="display:;" class="fast_price">
		            <p class="top">每间每晚 <span class="red">¥</span>
		            <span class="price">898</span>起	</p>
		            <p class="tc none">或拨打<br/>4006-161616</p>
		            <p id="quanId"><span class="qt">&nbsp;券40</span><a class="xuna" id="hrfCoupon" href="#">使用艺龙消费券预订，最高返40元现金</a></p>
		            <p class="view-room"><a href="/detail_cn_50101463.html#room" title="查看房型北京文津国际酒店">查看房型</a></p>  -->  
		            <!--头部价格结束-->
		        <!-- </div>-->  
		         
		        <!--酒店基本信息 开始-->
		        <div>
		            <div class="pt8"><h1><%=hoteldetail[1] %></h1></div>
		            <ul id="ulBasicInfolist"><!--地址项-->
		                        <li id="addresshtml">地址：<%=hoteldetail[2] %></li>
		               <!--区域项 开始-->
		            <li id="liElong" style="display: block;">区域：<%=impl.getRegionByHotelid(hotelid) %></li>
		        <!--区域项 结束-->
		              <!--电话项 开始-->
		                        <li>电话：<%=hoteldetail[4] %></li>
		              <!--电话项 结束-->
		            </ul>
		        </div>
		        <!--酒店基本信息 结束-->
		        <div class="clear"></div>
		      </div>
		    </div>
		      <!--顶部酒店信息 end-->
		      <!--tab-->
		      <a name="room"></a>
		    <div class="tab mt10 clx">
		        <ul>
		          <li id="jieshao" class="on"><a href="http://www.ijiutian.com/hotel/hoteldetail.do?hotelid=<%=hotelid %>">酒店介绍</a></li>
		          <li id="dianping"><a href="javascript:void(0)">住客点评</a></li>
		        </ul>
		        <div class="clear"></div>
		      </div>
		      <!--tab end-->
		      <!--酒店信息开始-->
		    <div id="hotelcontent" class="detail_box clx">
		        <!--酒店三要素-->
		        <div class="important">
		          <div class="box mr15">
		            <table id="hrf3602" width="100%">
		              <tbody><tr><td>
		                <div id="photos" class="pic_dom"><a href="javascript:void(0);"><img src="../hotelphoto/big/<%=hoteldetail[5] %>.jpg"/></a>
		                <a style="display:;" href="#" class="play">&nbsp;</a>
		                </div>
		              </td></tr></tbody>
		            </table>
		          </div>
		          <!--酒店地图-->
		          <div class="box mr15">
		            <div class="map_dom">
		                <div id="smallmap" style="width: 217px; height: 202px; overflow: hidden; position: relative;" title="放大地图"></div>
		                <div class="false" title="放大地图" id="bigmap"></div>
		             </div>
		          </div>
		          <!--住客点评-->
		  <div class="box" id="divcomment" title="查看全部点评">
		            <div class="comments_dom" title="查看全部点评">
		                  <p class="score" title="查看全部点评">
		                  <%=tuiJianBi%>%<span class="t14 orange pl5">顾客推荐</span>
		                  </p>
		                  <div title="查看全部点评" class="theline"><span style="width:<%=tuiJianBi%>%"></span><!--宽度为好评用户百分比数--></div>
		                  <div title="查看全部点评" class="pl tc">
		                    <%=tuiJian %>人推荐/<%=buTuiJian %>人不推荐
		                  </div>
		                </div>
		       </div>
		          <div class="clear"></div>
		        </div>
		        <!--酒店三要素 end-->
		        
		        <!--促销信息-->
		        <!--促销信息 end-->
		        <!--房型信息-->
		        <!--
		        <input type="hidden" id="CheckInDate" name="CheckInDate" value=""/>
		        <input type="hidden" id="CheckOutDate" name="CheckOutDate" value=""/>-->
		       <div class="ssu">
		          <span class="left pl10 bold">房型与房价</span><font id="fntInOutDate"><%=CheckInDate.substring(5,7) %>月<%=CheckInDate.substring(8,10) %>日入住，<%=CheckOutDate.substring(5,7) %>月<%=CheckOutDate.substring(8,10) %>日退房</font><!-- <a href="#" id="hrfApplySearch" class="bold underline">修改日期</a> -->
		        </div>
		      <div class="room_info" id="dvHotelListRegion">
		          <div class="top"><span class="l left"></span><span class="r right"></span></div>
		          <div class="detail_rm">
		            <div class="top"><span class="l left"></span><span class="r right"></span></div>
		            <ul class="model">
		              <li class="title">
		              <span class="w1">房型</span><span class="w4">床型</span><span class="w4">早餐</span><span class="w4">宽带</span><span class="w3">前台价</span><span class="w3">X程价</span><span class="w3">艺X价</span><span class="w3">九天价</span><span class="w4">发票</span><span class="w4">刷卡</span>
		              </li>
		              <%for(int i=0;i<roominfo.size();++i) {
		               Object[] oneroom=roominfo.get(i);
		              %>
		              <li>
			              <span class="w1"><%=oneroom[0] %></span><span class="w4"><%=oneroom[1] %></span><span class="w4"><%=oneroom[2] %></span><span class="w4"><%=oneroom[3] %></span><span class="w3"><a href="#" class="xun"><%=oneroom[4] %></a></span><span class="w3"><a href="#" class="xun"><%if(oneroom[8]==null) out.print("--"); else out.print(oneroom[8]); %></a></span><span class="w3"><a href="#" class="xun"><%if(oneroom[9]==null) out.print("--"); else out.print(oneroom[9]); %></a></span><span class="w3"><a href="#" class="xun"><%=oneroom[5] %></a></span><span class="w4"><%=oneroom[10] %></span><span class="w4"><%=oneroom[11] %></span><span class="w5"><input value="预订" class="d_book_ok" onclick="goToOrderPage(<%=oneroom[6] %>,<%=oneroom[4] %>)" onmousedown="this.className='d_book_on'" onmouseup="this.className='d_book_ok'" type="button"/></span>
		              </li>
		              <%} %>
		            </ul>
		            <div class="tc p15" id="divLoading" style="display:none"><span class="com_loading"></span>正在加载房型列表，请稍等…</div>
		            <div class="down"><span class="l left"></span><span class="r right"></span></div>
		          </div>
		           <div class="down"><span class="l left"></span><span class="r right"></span></div>
		        </div>
		        <div class="pb5 tr">
		      </div>
		<div class="elist clx" style="display:none;">
		</div>
		        <!--房型信息 end-->
		        <!-- 搜索结果不符合情况-->
		        <!-- 搜索结果不符合情况-->
		        <!--酒店其它信息-->
		        <div class="mt20">
		           <div class="o_title"><span></span><h2><%=hoteldetail[1] %>交通位置：</h2><span class="two"></span></div>
		          <div class="clear"></div><span id="jiaotongweizhis"><%=hoteldetail[6] %></span>
		          </div>
		        
		         <div class="mt20">
		            <div class="o_title"><span></span><h2><%=hoteldetail[1] %>客人印象</h2><span class="two"></span></div>
		          <div class="clear"></div>
		            <div class="p10">
		                　　<%=hoteldetail[7] %>
		            </div>
		        </div>
		        <div class="mt20">
		           <div class="o_title"><span></span><h2><%=hoteldetail[1] %>客人点评</h2><span class="two"></span></div>
		          <div class="clear"></div>
		          <div class="traffic_info">
		          	<%=hoteldetail[8] %>
		          </div>
		        </div>
		        <div class="mt20">
		           <div class="o_title"><span></span><h2><%=hoteldetail[1] %>高校位置</h2><span class="two"></span></div>
		          <div class="clear"></div>
		          <div class="traffic_info">
		          	<%=hoteldetail[9] %>
					<br/>
		          </div>
		        </div>
		        </div>
		      <!--酒店其它信息 end-->
		      
		      </div>
		      <!--其它酒店推荐-->
		    <!--酒店信息开始 end-->    
  
    	<div class="h_l">
    	  <form name="searchForm" action="/hotel/searcharound.do" method="post" onsubmit="return searchsubmit()">
			<div class="search_box" id="dvListSearchRegion">
			    <div class="top">    </div>
			    <dl>
			        <dt>
			            城&nbsp;&nbsp;&nbsp;&nbsp;市：</dt>
			        <dd>
			            <input id="InCityName" maxlength="20" value="北京" class="city-i choose l_black" name="InCityName" type="text"/></dd>
			        <dt>
			            入住日期：</dt>
			        <dd>
			            <input id="CheckInDate" name="CheckInDate" value="<%=todayAndTommorow.get(0) %>" class="time-i choose l_black" type="text"/></dd>
			        <dt>
			            退房日期：</dt>
			        <dd>
			            <input id="CheckOutDate" name="CheckOutDate" value="<%=todayAndTommorow.get(1) %>" class="time-i choose l_black" type="text"/></dd>
			        <dt>
			            酒店名称：</dt>
			        <dd>
			            <input id="HotelName" name="HotelName" value="如：如家" class="text choose l_black com_input" id="txtSearchText" type="text"/></dd>
			                
			        <dt>酒店靠近：</dt>
			        <dd>
			            <input id="Region" name="Region" value="如：清华大学" class="text choose l_black" id="txtSearchNear" type="text"/></dd>
			        
			        <dd class="btn_box">
			            <input id="searchbutton" value="重新搜索" onfocus="this.blur()" onmouseout="this.className='com_search75'" onmouseup="this.className='com_search75'" onmousedown="this.className='com_search75_an'" class="com_search75" type="submit"/></dd>
			    </dl>
			    <div class="down">
			    </div>
			</div>
	      </form>
    	</div>
		<div class="clear"> </div>
	</div>
<div id="bigmapwindow" style="text-align:left;display:none;overflow:hidden">
	<p style="font-size: 12px;font-weight:bold;margin-bottom:0px;margin-top:0px"><%=hoteldetail[1] %></p>
<p style="font-family:Tahoma,simsun;font-size:12px;line-height:20px;margin-bottom:2px;margin-top:0px">地址：<%=hoteldetail[2] %></p>
<div style="overflow:hidden;width:570px;height:300px;border:1px solid gray;text-align:center;" id="container"></div>
<div>
<p style="font-size: 12px;font-weight:bold;margin-bottom:2px;margin-top:2px">交通位置：</p>
<div style="height:100px;overflow-y:auto;font-family: Tahoma,simsun;font-size: 12px;line-height: 20px;" id="jiaotongweizhi"></div>
</div>
</div>
<jsp:include page="/hotel/footer.jsp" />
  </body>
</html>
